<table class="content" align="center" cellpadding="0" cellspacing="0">           
	<?php if(count($mlist)==0) {?>
    <tr>
        <td class="content_title_top">
        <div align="left">
        <?php if(isset($search)){?>
        <?php echo Kohana::lang('product_lang.tt_search')?>  <?php echo Kohana::lang('product_lang.tt_page') ?>
        (<?php echo $total;?> <?php echo Kohana::lang('shoppingcart_lang.lbl_item_s')?>)
        <?php } else {?>
        <a href="<?php echo $this->site['base_url'] ?>product"><?php echo Kohana::lang('product_lang.tt_page') ?></a>
        <?php } ?>
        </div>
        </td>
    </tr>
	<?php } else { ?>
    <tr>
        <td class="content_title_top" align="left" style="text-align:left;">
        <div align="left">
        <?php if(isset($search)){?>
        <?php echo Kohana::lang('product_lang.tt_search')?>  <?php echo Kohana::lang('product_lang.tt_page') ?>
        (<?php echo $total;?> <?php echo Kohana::lang('shoppingcart_lang.lbl_item_s')?>)
        <?php } else {?>
        <a href="<?php echo $this->site['base_url'] ?>product"><?php echo Kohana::lang('product_lang.tt_page') ?></a>
        <?php if(isset($mr['categories_id'])&&$mr['categories_id']){?>
        <a href="<?php echo $this->site['base_url'].'product/cat/'.$mr['categories_id'] ?>">
        &gt;&gt;&nbsp;<?php echo $mr['categories_name'] ?></a>
        <?php }?>
        <?php } ?>
        </div>
        </td>
    </tr>
    <?php } ?>
    <tr>
        <td class="content_middle">
        <div>
        <form name="frm_sort" method="post" action="<?php echo $this->site['base_url']?>product/sort" >
        <div style="width:190px;float:right">
        <?php echo Kohana::lang('product_lang.lbl_sort_by') ?>            
        <select name="sel_sort" id="sel_sort" onchange="document.frm_sort.submit()">
            <option value="">---</option>
            <option value="asc" <?php if(isset($sort) && $sort=='asc') echo 'selected="selected"'?> ><?php echo Kohana::lang('product_lang.lbl_asc') ?></option>
            <option value="desc" <?php if(isset($sort) && $sort=='desc') echo 'selected="selected"'?>><?php echo Kohana::lang('product_lang.lbl_desc') ?></option>
            <option value="asc_price" <?php if(isset($sort) && $sort=='asc_price') echo 'selected="selected"'?> ><?php echo Kohana::lang('product_lang.lbl_asc_price') ?></option>
            <option value="desc_price" <?php if(isset($sort) && $sort=='desc_price') echo 'selected="selected"'?> ><?php echo Kohana::lang('product_lang.lbl_desc_price') ?></option>
            <option value="looked" <?php if(isset($sort) && $sort=='looked') echo 'selected="selected"'?> ><?php echo Kohana::lang('product_lang.lbl_looked') ?></option>
            <option value="purchased" <?php if(isset($sort) && $sort=='purchased') echo 'selected="selected"'?> ><?php echo Kohana::lang('product_lang.lbl_purchased') ?></option>
        </select>            
        </div>
        </form>
        <form name="frm_per_page" method="post" action="<?php echo $this->site['base_url']?>product/per_page" >
        <div style="width:120px;float:right">
        <select name="sel_per_page" id="sel_per_page" onchange="document.frm_per_page.submit()">
            <option value="">---</option>
            <option value="10" <?php if(isset($per_page) && $per_page=='10') echo 'selected="selected"'?> >10</option>   
            <option value="20" <?php if(isset($per_page) && $per_page=='20') echo 'selected="selected"'?> >20</option>
            <option value="50" <?php if(isset($per_page) && $per_page=='50') echo 'selected="selected"'?> >50</option>
            <option value="100" <?php if(isset($per_page) && $per_page=='100') echo 'selected="selected"'?> >100</option>    
        </select> 
        <?php echo Kohana::lang('product_lang.lbl_per_page') ?>           
        </div> 
        </form>
        <div style="width:135px;padding-top:5px;float:right">
        <?php echo Kohana::lang('product_lang.lbl_view_as') ?>:
        <?php if(isset($mode) && $mode == 'list'){?>
        <a href="<?php echo $this->site['base_url']?>product/mode/grid"><?php echo Kohana::lang('product_lang.lbl_grid') ?></a>
        |
        <a href="<?php echo $this->site['base_url']?>product/mode/list"><strong><?php echo Kohana::lang('product_lang.lbl_list') ?></strong></a>
        <?php } else {?>
        <a href="<?php echo $this->site['base_url']?>product/mode/grid"><strong><?php echo Kohana::lang('product_lang.lbl_grid') ?></strong></a>
        |
        <a href="<?php echo $this->site['base_url']?>product/mode/list"><?php echo Kohana::lang('product_lang.lbl_list') ?></a>
        <?php } ?>
        </div>              
        </div>
        </td>
    </tr>		
    <tr>
    <td class="content_middle">
    <?php if(isset($mode) && $mode == 'list'){?>
	<?php require('mode_list.php')?>
    <?php } else {?>
    <?php require('mode_grid.php')?>
    <?php } ?>
   	</td>
   	</tr>
   <tr>
    <td align="right" class="content_middle">
    <div class='pagination'><?php echo $this->pagination->render()?></div>    
    </td>
   </tr>
  <tr>
    <td class="content_bottom">&nbsp;</td>
  </tr>
</table>